/*
 * @Author: 杨超
 * @Date: 2021-10-18 09:45:08
 * @LastEditTime: 2021-10-19 15:06:36
 * @LastEditors: 杨超
 * @Description:
 */
import { RoadPlanApi } from '@/api'
import CommonModel from './common'

class RoadPlanModel extends CommonModel {
    constructor() {
        super()
        this.api = new RoadPlanApi()
    }

    detail(data, filter) {
        return this.api.detail(data).then(res => {
            if (filter) {
                const result = this.transformNull(res)
                return result
            }
            return res
        })
    }

    // 提交
    submit(number) {
        const data = { number }
        return this.api.submit(data)
    }

    // 撤回
    recall(number) {
        const data = { number }
        return this.api.recall(data)
    }

    // 编辑页详情
    getEditDetail(data) {
        return this.api.getEditDetail(data)
    }

    // 获取计划内容列表，用于季度和月度新建展示
    getPlanContent(data) {
        return this.api.getPlanContent(data)
    }

    // 获取当前公路已创建周期列表，用于限制年度和季度选择
    getPeriodList(data) {
        return this.api.getPeriodList(data)
    }
}

export default RoadPlanModel
